# Note that this is a deployment script with hardcoded paths
# Use only as a guide for a deployment strategy

from os import path
from tardis.settings_changeme import *

# Database settings
DATABASES = {
    'default': {
        # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'ENGINE': 'django.db.backends.sqlite3',
        # Name of the database to use. For SQLite, it's the full path.
        'NAME': path.join(path.dirname(__file__),'django.sql').replace('\\','/'),    
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

# Root URLs in HPCTardis
ROOT_URLCONF = 'tardis.apps.hpctardis.urls'

# extend template directory to TEMPLATE_DIRS
tmp = list(TEMPLATE_DIRS)
tmp.append(path.join(path.dirname(__file__),
                     'apps/hpctardis/publish/').replace('\\', '/'),
    )
tmp.append(path.join(path.dirname(__file__),
                     'tardis_portal/publish/').replace('\\', '/'),
    )
TEMPLATE_DIRS = tuple(tmp)

# Post Save Filters
tmp = list(POST_SAVE_FILTERS)
tmp.append(("tardis.apps.hpctardis.filters.metadata.make_filter", ["",""]))
POST_SAVE_FILTERS = tuple(tmp)

# Location of media for admin tool
ADMIN_MEDIA_STATIC_DOC_ROOT = path.join(path.dirname(__file__),'../eggs/Django-1.3-py2.6.egg/django/contrib/admin/media/').replace('\\', '/')

# Where experiment data is stored
FILE_STORE_PATH = path.abspath(path.join(path.dirname(__file__),
                                         '../var/store/'))
#Where experiment data is sourced
STAGING_PATH = path.abspath(path.join(path.dirname(__file__),
                                      "../var/staging/"))
STAGING_PROTOCOL = 'localdb'

# Directory path for image thumbnails
THUMBNAILS_PATH = path.abspath(path.join(path.dirname(__file__),
    '../var/thumbnails/')).replace('\\', '/')

#Add hpctardis to default set of tardis apps
INSTALLED_APPS = (TARDIS_APP_ROOT+".hpctardis",) + INSTALLED_APPS

# Template loaders
TEMPLATE_LOADERS = (
    'django.template.loaders.app_directories.Loader',
    'django.template.loaders.filesystem.Loader',
)


# HPCTardis Media
HPC_STATIC_URL_ROOT = '/static'
HPC_STATIC_DOC_ROOT = path.join(path.dirname(__file__),
                               'apps/hpctardis/static').replace('\\', '/')

# logging levels are: DEBUG, INFO, WARN, ERROR, CRITICAL
SYSTEM_LOG_LEVEL = 'INFO'
MODULE_LOG_LEVEL = 'INFO'

SYSTEM_LOG_FILENAME = 'request.log'
MODULE_LOG_FILENAME = 'tardis.log'

#Sending email auths information
EMAIL_PORT = 587 
EMAIL_HOST = 'my.smtpserver.com'
EMAIL_HOST_USER = 'me@myemail.com'     
EMAIL_HOST_PASSWORD = 'PASSWORD'
EMAIL_USE_TLS = True
# the hostname used in validation emails
EMAIL_LINK_HOST = "http://12.0.0.1"

# Site specific RIFCS codes (overide as needed)
# The anzsrc codes for subject for all collections
COLLECTION_SUBJECTS = ['0307','0204']
GROUP = "Acme University"
GROUP_ADDRESS = "Applied Science, Acme University, Melbourne VIC 3000, Australia"
ACCESS_RIGHTS= "Contact the researchers/parties associated with this dataset"
RIGHTS= "Terms and conditions applies as specified by the researchers"

# Researchers requested that all though metadata is available for public experiments,
# all data access is redirected to contact page.   True does this, and False reverts
# to standard myTardis behavior where all data is accessable if experiment is public
# If True, then all public datasets redirect to contact page.
PRIVATE_DATAFILES = True
